<template>
<h1>事件绑定指令</h1>
  <button @click="f()">按钮1</button>
  <button v-on:click="f()">按钮2</button>

  <h3>回车按下事件</h3>
  <button v-on:keydown.enter="f()">回车1</button>
  <button @keydown.enter="f()">回车2</button>
  <input type="text" @keydown.enter="enter()">
</template>

<script setup>
  const f =()=>{
    alert('点击了')
  }
  const enter =()=>{
    alert('鞋子')
  }
</script>

<style scoped>

</style>